#include <stdio.h>
/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     struct ListNode *next;
 * };
 */

//https://leetcode.cn/problems/remove-duplicates-from-sorted-list/description/
struct ListNode* deleteDuplicates(struct ListNode* head) {
    struct ListNode* cur = head;
    while (cur)
    {
        if (cur->next)
        {
            if (cur->val == cur->next->val)
            {
                struct ListNode* tmp = cur->next;
                cur->next = cur->next->next;
                free(tmp);
                tmp = NULL;
            }
            else
            {
                cur = cur->next;
            }
        }
        else
            cur = NULL;
    }
    return head;
}

int main()
{
    return 0;
}